﻿@model GameSchoolApplication.Models.Level

@{
    ViewBag.Title = "Nánar um borð";
    Layout = "~/Views/Shared/_TeacherMore.cshtml";
}
<section class="TeacherMainContent">
<h2>Nánar um borð: @Html.DisplayFor(model => model.Title)</h2>

<table class="IndexTable">
    <caption>Myndbönd</caption>
    @if (Model.Videos.Count == 0)
    {
        <tr><td>Engin myndbönd skráð</td></tr>
    }
    else
    {
        <tr>
            <th>Titill</th>
            <th>Slóð</th>
        </tr>
        foreach (var video in Model.Videos)
        { 
            <tr>
                <td>@video.Title</td>
                <td><a href="@video.VideoPath">@video.VideoPath</a></td>
            </tr> 
        }
    }
</table>
<p>@Html.ActionLink("Bæta við myndbandi", "Create", "Video", new { levelId = Model.LevelId }, new {})</p>

<table class="IndexTable">
    <caption>Próf</caption>
    @if (Model.Tests.Count == 0)
    {
        <tr><td>Engin próf skráð</td></tr>
    }
    else
    {
        <tr>
            <th>Nafn</th>
            <th>Fjöldi spurninga</th>
            <th>Hámarksfjöldi stiga</th>
            <th>&nbsp;</th>
        </tr>
        foreach (var test in Model.Tests)
        { 
            <tr>
                <td>@test.TestName</td>
                <td>@test.Questions.Count</td>
                <td>@test.MaxPoints</td>
                <td>@Html.ActionLink("Nánar", "Details", "Test", new { id = test.TestId }, new { })</td>
            </tr> 
        }
    }
</table>
<p>@Html.ActionLink("Bæta við prófi", "Create", "Test", new {levelId = Model.LevelId}, new {})</p>

<table class="IndexTable">
    <caption>Verkefni</caption>
    @if (Model.Assignments.Count == 0)
    {
        <tr><td>Engin verkefni skráð</td></tr>
    }
    else
    {
        <tr>
            <th>Titill</th>
            <th>Hámarksfjöldi stiga</th>
            <th>Fjöldi skiladaga</th>
            <th>&nbsp;</th>
        </tr>
        foreach (var assignment in Model.Assignments)
        { 
            <tr>
                <td>@assignment.Title</td>
                <td>@assignment.MaxPoints</td>
                <td>@assignment.Days</td>
                <td>@Html.ActionLink("Nánar", "Details", "Assignment", new { id = assignment.AssignmentId }, new { })</td>
            </tr> 
        }
    }
</table>
<p>@Html.ActionLink("Bæta við verkefni", "Create", "Assignment", new {levelId = Model.LevelId}, new {})</p>

<p>
    @Html.ActionLink("Breyta borði", "Edit", new { id = Model.LevelId }) |
    @Html.ActionLink("Til baka í lista", "Index", new { gameId = Model.GameId })
</p>
</section>